<template>
  <div>
    <div class="penalrow selectw100">
      <div class="inlineblock verticalmiddle infoitem" style="width:33%;">
        <div class="inlineblock verticalmiddle">
          开始日期
        </div>
        <div class="inlineblock verticalmiddle informationItem">
          <el-date-picker size="mini" :editable="datapickereditable" type="date" placeholder="选择起始日期" style="width:100%;">
          </el-date-picker>
        </div>
      </div>
      <div class="inlineblock verticalmiddle infoitem" style="width:33%;">
        <div class="inlineblock verticalmiddle">
          结束日期
        </div>
        <div class="inlineblock verticalmiddle informationItem">
          <el-date-picker size="mini" :editable="datapickereditable" :picker-options="pickerenddatefanwei" type="date" placeholder="选择结束日期"
            style="width:100%;">
          </el-date-picker>
        </div>
      </div>
      <div class="basicRightDistanceA" style="position:absolute;">
        <el-button type="primary" size="mini">搜索</el-button>
      </div>
    </div>
    <div class="separaterow">
      <el-table :data="useRecordTableDate" style="width: 100%" :height="tableHeightD" size="mini" key="useRecordTableDate">
        <el-table-column label="序号" min-width="50px">
          <template slot-scope="scope">
            {{scope.$index+1}}
          </template>
        </el-table-column>
        <el-table-column property="useRecordStartTime" label="开机时间" min-width="110px">
        </el-table-column>
        <el-table-column property="useRecordEndTime" label="关机时间" min-width="110px">
        </el-table-column>
        <el-table-column property="useRecordTemperature" label="温度" min-width="100px">
        </el-table-column>
        <el-table-column property="useRecordHumidity" label="湿度" min-width="100px">
        </el-table-column>
        <el-table-column property="useRecordStatus" label="状况" min-width="100px">
        </el-table-column>
        <el-table-column property="sampleNum" label="样品数量" min-width="100px">
        </el-table-column>
        <el-table-column label="测试批" min-width="100px">
          <template slot-scope="scope">
            <el-button type="text" size="mini" @click="zhuisuShow=true">{{11000+scope.$index}}</el-button>
          </template>
        </el-table-column>
        <el-table-column property="createByName" label="使用人" min-width="100px">
        </el-table-column>
        <el-table-column label="操作" fixed="right" min-width="180px">
          <template slot-scope="scope">
            <el-button type="text" size="mini">查看使用检查项</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="block changepages">
        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page" :page-sizes="[100, 200, 300, 400]"
          :page-size="100" layout="total, sizes, prev, pager, next, jumper" :total="400">
        </el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
  import { mapState } from 'vuex'
  export default {
    props: { useRecordData: Object },
    data() {
      return {
        page: 1,
        tableHeightD: ((window.innerHeight - 300) / 3 - 25),
        datapickereditable: false,
        demand: {
          id: '',
          startDate: '',
          endDate: '',
        },
        pickerenddatefanwei: {
          disabledDate: function (time) {
            //	            let timeSpace = time.getTime() < new Date((this.batchcreatetimestart?this.batchcreatetimestart:'1970-01-01')).getTime();
            //	            return timeSpace;
          }
        },
        //使用记录
        useRecordTableDate: [],
      }
    },
    mounted() {
      this.demand.id = this.useRecordData.id
      this.init()
    },
    methods: {
      init() {
        this.$http({
          apiUrl: 'resource/readEquipmentUseList.htm',
          method: 'get',
          params: this.demand,
        }).then(res => {
          if (res.code == 0) {
            console.log(res.data)
          }
        })
      },
      handleSizeChange() { },
      handleCurrentChange() { },
    }
  }

</script>

<style>

</style>